package ApplicationStart.Domain;

import org.springframework.context.annotation.Profile;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

//interface can mutliple extends
public interface UserCreditRepository extends JpaRepository<UserCredit, Integer>, JpaSpecificationExecutor<UserCredit> {
    List<UserCredit> findAllByUserId(Integer userId);
    @Query("select uc from UserCredit uc where uc.id > :lowId and uc.id < :heightId")
    List<UserCredit> getAllByIdBetween(@Param("lowId") Integer lowId, @Param("heightId") Integer heightId);
}
